import type { ComponentSize } from '@/constants/size'
import type { Component } from 'vue'
import HGrade from './HRate.vue'

export type Colors = string[] | Record<number, string>

export type Icons = string[] | Component[] | Record<number, string | Component>

export interface GradeProps {
    max?: number,
    size?: ComponentSize,
    disabled?: boolean,
    allowHalf?: boolean,
    lowThreshold?: number,
    highThreshold?: number,
    colors?: Colors,
    voidColor?: string,
    disabledVoidColor?: string,
    icons?: Icons,
    voidIcon?: string | Component,
    disabledVoidIcon?: string | Component,
    // showText?: boolean,
    // showScore?: boolean,
    // textColor?: string,
    // texts?: string[],
    scoreTemplate?: string,
    clearable?: boolean,
    id?: string,
}

export interface GradeEmits {
    change: [value: number]
}

export type GradeInstance = InstanceType<typeof HGrade>